package com.szzg10.thinking.chapter18;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;

public class FormattedMemoryInput {

	public static void main(String[] args) throws IOException {
		String str = BufferedInputFile.read(BufferedInputFile.FILE_NAME);
		
		byte[] bytes = str.getBytes();
		ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
		
		DataInputStream in = new DataInputStream(byteArrayInputStream);
		int i = in.available();
		for(int j = 0; j < i; j++) {
			char c = (char)in.readByte();
			System.out.print(c);
		}
		
	}
}
